<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"
	xmlns:t="https://code.google.com/p/rad-framework/taglib"
	xmlns:tt="https://code.google.com/p/rad-framework"
	xmlns:s="http://jboss.com/products/seam/taglib">
	
	<rich:spacer width="1" height="5"/>
	
	<a4j:form id="orderingForm#{folder.id}">
		
		<rich:orderingList id="orderingList#{folder.id}"
			value="#{folder.childrenList}" var="kid" listWidth="600"
			controlsHorizontalAlign="left" controlsVerticalAlign="top"
			converter="rad.framework.jsf.EntityTreeNodeConverter">
			
			<c:forEach items="#{folder.columns}" var="c">
				<rich:column rendered="#{c.rendered}">
					<f:facet name="header">#{c.label}</f:facet>
					<h:outputText>#{c.value}</h:outputText>
				</rich:column>
			</c:forEach>
			
			<rich:column width="1%">
				<f:facet name="header">
					<h:outputText value="#{messages['Action']}"/>
				</f:facet>

				<tt:link id="viewLink"
					styleClass="rad-framework-form-link"
					entityName="#{kid.type}"
					mode="View"
					key="#{kid.key}"
					rendered="#{kid.renderView}">
					<h:graphicImage value="#{messages['ViewIcon']}" border="0"
						title="#{messages['View']}"/>
					<s:conversationId/>
				</tt:link>
					
				<tt:link id="editLink"
					styleClass="rad-framework-form-link"
					entityName="#{kid.type}"
					mode="Edit"
					key="#{kid.key}"
					rendered="#{kid.renderEdit}">
					<h:graphicImage value="#{messages['EditIcon']}" border="0"
						title="#{messages['Edit']}"/>
					<s:conversationId/>
				</tt:link>
				
				<a4j:commandLink
					rendered="#{(renderDelete == null ? true : renderDelete) and kid.renderDelete and not folder.manyToMany}"
					onclick="if (!confirm('#{messages['DeleteConfirmation']}')) return false"
					styleClass="rad-framework-form-link" reRender="#{folder.id}TP"
					eventsQueue="viewQ" action="#{kid.delete}">
					<h:graphicImage value="#{messages['DeleteIcon']}" border="0"
						title="#{messages['Delete']}"/>
					<s:conversationId/>
				</a4j:commandLink>
			</rich:column>
			
			<a4j:support event="onorderchanged"
				reRender="orderingList#{folder.id}"/>
		</rich:orderingList>
		
	</a4j:form>
</ui:composition>